home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / dev / c / libiconv_src.lha / src / ucs4internal.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-07  |  451 b   |  24 lines

  1. /*
  2.  * UCS-4-INTERNAL = UCS-4 with machine dependent endianness and alignment
  3.  */
  4.  
  5. static int
  6. ucs4internal_mbtowc (conv_t conv, wchar_t *pwc, const unsigned char *s, int n)
  7. {
  8.   if (n >= 4) {
  9.     *pwc = *(const unsigned int *)s;
  10.     return 4;
  11.   }
  12.   return RET_TOOFEW(0);
  13. }
  14.  
  15. static int
  16. ucs4internal_wctomb (conv_t conv, unsigned char *r, wchar_t wc, int n)
  17. {
  18.   if (n >= 4) {
  19.     *(unsigned int *)r = wc;
  20.     return 4;
  21.   } else
  22.     return RET_TOOSMALL;
  23. }
  24.